package com.kyzh.core.adapters

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.gushenge.core.beans.Video
import com.kyzh.core.pager.weal.video.VideoPlayerFragment

/**
 * @author Yun.Lei
 * @email waitshan@163.com
 * @date 2020/1/18
 */
class VideoPagerAdapter(fragment: Fragment, private val list:MutableList<Video>) : FragmentStateAdapter(fragment) {

    override fun getItemCount(): Int = list.size

    override fun createFragment(position: Int): Fragment = VideoPlayerFragment.getNewInstance(list[position])
}